package com.example.universitylibraryback.config;

import com.example.universitylibraryback.pipeline.filter.BorrowRequestParserFilter;
import com.example.universitylibraryback.pipeline.filter.ValidationFilter;
import com.example.universitylibraryback.pipeline.filter.ReaderQualificationFilter;
import com.example.universitylibraryback.pipeline.filter.BookStatusFilter;
import com.example.universitylibraryback.pipeline.filter.BorrowRecordCreationFilter;
import com.example.universitylibraryback.pipeline.filter.BookStatusUpdateFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration // 标记为配置类
public class FilterConfig {
    // 手动注册BorrowRequestParserFilter为Bean
    @Bean
    public BorrowRequestParserFilter borrowRequestParserFilter() {
        return new BorrowRequestParserFilter();
    }
    
    // 手动注册ValidationFilter为Bean
    @Bean
    public ValidationFilter validationFilter() {
        return new ValidationFilter();
    }
    
    // 手动注册ReaderQualificationFilter为Bean
    @Bean
    public ReaderQualificationFilter readerQualificationFilter() {
        return new ReaderQualificationFilter();
    }
    
    // 手动注册BookStatusFilter为Bean
    @Bean
    public BookStatusFilter bookStatusFilter() {
        return new BookStatusFilter();
    }
    
    // 手动注册BorrowRecordCreationFilter为Bean
    @Bean
    public BorrowRecordCreationFilter borrowRecordCreationFilter() {
        return new BorrowRecordCreationFilter();
    }
    
    // 手动注册BookStatusUpdateFilter为Bean
    @Bean
    public BookStatusUpdateFilter bookStatusUpdateFilter() {
        return new BookStatusUpdateFilter();
    }
}